package com.bay1ts.security;

import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl;

public class CustomTokenRepository extends JdbcTokenRepositoryImpl {
	public static final String DEF_REMOVE_USER_TOKENS_SQL = "delete from persistent_logins where username = ? order by last_used asc limit 1";
	private String tokensBySeriesSql = DEF_TOKEN_BY_SERIES_SQL;
	private String insertTokenSql = DEF_INSERT_TOKEN_SQL;
	private String updateTokenSql = DEF_UPDATE_TOKEN_SQL;
	private String removeUserTokensSql = DEF_REMOVE_USER_TOKENS_SQL;
	private boolean createTableOnStartup;
	public void removeUserTokens(String username) {
		getJdbcTemplate().update(removeUserTokensSql, username);
	}

}
